package Services;

import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;

import Donnees.Transport;
import dao.Implementation.TransportDAO;

@ManagedBean
public class sTransport {
	List<Transport> listeTransport = new ArrayList<Transport>();
	TransportDAO transportDao = new TransportDAO();
	Transport transport = new Transport();
	
	public sTransport(){
		listeTransport = getListeTransport();
	}
	public List<Transport> getListeTransport() {
		listeTransport = transportDao.selectAll();
		return listeTransport;
	}

	public void insertTransport(Transport s) {
		transportDao.insert(s);
	}
	public void deleteTransport(Transport s) {
		transportDao.delete(s);
	}
	public Transport getTransportById(String type) {
		transport = transportDao.getByType(type);
		return transport;
	}
}
